<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>2776：斩草除根</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">斩草除根</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">斩草除根</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                斩草除根                </h1>
                <p>时间限制：10s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：512MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div style="text-indent: 21.75pt"><span style="font-size: medium">果然，在KD举世无双的完美计算下，敌人的SUG受到了毁灭性的打击，所以即使因为你怕死在上一章开溜了也不会有碍大局，KD此时对整个战争的胜利已经是胸有成竹了。</span></div>
<div style="text-indent: 21.75pt"><span style="font-size: medium">说时快，那时迟，时机俨然已经成熟，于是KD的纤纤玉指温文尔雅的一按（大误），所有的定时炸弹在一刹那间全部爆炸了。眼见敌人基地被炸的面目全非，KD此时此刻才终于身临其境的感受到什么是&ldquo;Y笑间，樯撸灰飞烟灭&rdquo;。面对内忧外患苟延残喘的敌人，KD和它的偷袭部队势如破竹，将不堪一击的大难不死者杀个片甲不留（场面血腥，请不要模仿），畅通无阻的直入指挥室。而SG（S**t god）&mdash;&mdash;S部队新生的领袖早已心知肚明，大势已去。它望着已是举目无亲的战场，惟有泪流满面的沉吟着：&ldquo;一个人的时候，吃着金坷垃，吸收肚子里的那些氮磷钾，不流失不蒸发，还有零浪费啊。。。。。&rdquo;</span></div>
<div style="text-indent: 21.75pt"><span style="font-size: medium">&ldquo;报告，队员们已经开始七窍流血了。&rdquo;</span></div>
<div style="text-indent: 21.75pt"><span style="font-size: medium">&ldquo;唱个P啊，你想要毁灭世界嘛！看我代表月亮消灭你！&rdquo;KD摆了个POSE，SG直接被强大的内力击倒了。</span></div>
<div style="text-indent: 21.75pt"><span style="font-size: medium">&ldquo;为什么，为什么你能求出前几章的答案而打败我！&rdquo;</span></div>
<div style="text-indent: 21.75pt"><span style="font-size: medium">&ldquo;愚蠢的SG啊，因为我用了快速排序，可以快速将各种收集的信息有序化。&rdquo;</span></div>
<div style="text-indent: 21.75pt"><span style="font-size: medium">&ldquo;可恶，不懂得冒泡排序的你们又怎么能了解我们的苦衷！&rdquo;</span></div>
<div style="text-indent: 21.75pt"><span style="font-size: medium">&ldquo;那是因为你层次还不够啊，正因为对冒泡排序的理解已经震古烁今了，所以才开始使用快速排序啊。&rdquo;</span></div>
<div style="text-indent: 21.75pt"><span style="font-size: medium">&ldquo;不可能的。。那你告诉我，使用冒泡正好K轮可以排成有序的N的排列有多少个？&rdquo;</span></div>
<div style="text-indent: 21.75pt"><span style="font-size: medium">这个。。。。KD似乎难圆其说了，千钧一发之际KD忽然想到了几千年前买的一本武林秘籍上的咒语，于是马上合上双掌闭上双眼大喊：&ldquo;急急如勒令，各属性MM快降临！&rdquo;</span></div>
<div style="text-indent: 21.75pt"><span style="font-size: medium">结果看到战争结束了来打酱油的你出现了，那么，你自己看着办。</span></div></p><hr/><h3>输入格式</h3><p><div style="text-indent: 21pt"><span style="font-size: medium">第一行2个正整数N和K。</span></div></p><hr/><h3>输出格式</h3><p><div style="text-indent: 21pt"><span style="font-size: medium">一个整数ANS，表示计算出的答案。如果无法计算，请随意输出任何理由，KD都将以该测试点0分来惩罚你的失败。</span></div></p><hr/><h3>样例输入</h3><pre>8 5
</pre><hr/><h3>样例输出</h3><pre>    10920
</pre><hr/><h3>提示</h3><p><p>对于100%的数据，N&lt;=5000；0&lt;K&lt;N；LENGTH_ANS&lt;=20000。<br />
注意事项：<br />
由于KD的宽宏大量气度不凡，它为生命受到严重威胁的你解释传说中的冒泡排序：<br />
i从n-1到1循环<br />
（一轮的开始）</p>
<p><br />
&nbsp;j从1到i循环<br />
&nbsp;&nbsp;&nbsp; 如果a[j]&gt;a[j+1]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 交换a[j]和a[j+1]<br />
（一轮的结束）</p>
<p><a href="/JudgeOnline/upload/201604/sol(3).rar">JudgeOnline/upload/201604/sol(3).rar</a></p></p><hr/><h3>题目来源</h3><p>没有写明来源</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=2776" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=2776" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>